#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date    : 2020-08-25 17:31:04
# @Author  : Zuo Zhongfei (zuozhongfei@126.com)
# @Link    : www
# @Version : $Id$

import os

# current_number = 1
# while current_number <= 5:
#     print(current_number)
#     current_number += 1

# prompt = "\nTell me something, and I will repeat it to you:"
# prompt += "\nEnter 'quit' to end the program"
# message = ""
# while message != 'quit':
#     message = input(prompt)
#     if message != 'quit':
#         print(message)

# 要返回到循环开头，并根据条件测试结果决定是否继续执行循环，可使用continue语句，
# 它不像break语句那样不再执行余下的代码并退出整个循环。
# 例如，来看一个从1数到10，但只打印其中奇数的循环：
<<<<<<< HEAD
# current_number = 0
# while current_number < 10:
#     current_number += 1
#     if current_number % 2 == 0:
#         continue
#     print(current_number)

# 接收多个参数


def make_pizza(*toppings):
    print(toppings)


make_pizza('pepperoni')
make_pizza('mushrooms', 'green peppers', 'extra cheese')
# 形参名*toppings中的星号让Python创建一个名为toppings的空元组，并将收到的所有值都封装到这个元组中


def make_pizza1(*toppings):
    print('\nMaking a pizza whth the following toppints:')
    for topping in toppings:
        print('- ' + topping)


make_pizza1('pepperoni')
make_pizza1('mushrooms', 'green peppers', 'extra cheese')

# 如果要让函数接受不同类型的实参，
# 必须在函数定义中将接纳任意数量实参的形参放在最后。
# Python先匹配位置实参和关键字实参，再将余下的实参都收集到最后一个形参中。


def make_pizza2(size, *toppings):
    print('\nMaking a ' + str(size) + '-inch pizza whth the following toppints:')
    for topping in toppings:
        print('- ' + topping)


make_pizza2(3, 'pepperoni')
make_pizza2(5, 'mushrooms', 'green peppers', 'extra cheese')

# 向函数传递键值对
# 函数参数名前边加 ** ，这个参数会被函数封装为一个字典


def build_profile(first, last, **user_info):
    profile = {}
    profile['first_name'] = first
    profile['last_name'] = last

    for key, value in user_info.items():
        profile[key] = value
    return profile


user_profile = build_profile('zuo', 'Zhongfei', job='programmer', age=27, location='beijing')
print(user_profile)
=======
current_number = 0
while current_number < 10:
    current_number += 1
    if current_number % 2 == 0:
        continue
    print(current_number)

pets = ['a','a','e','a','a','v','b']
pets.remove('a')
print(pets)
>>>>>>> fdf146d9e03bdd1f89541e649f3bdf4269544959
